import { createApp } from "vue";
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
import App from "./App.vue";
import router from "./router";
import request from "./utils/request";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import zhCn from "element-plus/es/locale/lang/zh-cn"; // ✅ 中文语言包
import { createPinia } from "pinia";
import uppercase from "./utils/uppercase";
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
const app = createApp(App);
const pinia = createPinia();
pinia.use(piniaPluginPersistedstate);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}

app.config.globalProperties.$request = request;
app.directive("uppercase", uppercase);
app
    .use(router)
    .use(ElementPlus, { size: "small", locale: zhCn })
    .use(pinia)
    .mount("#app");
